<?
layout("/inc/win_layout.html",{title:sysTitle}){
?>
	<script type="text/javascript" src="static/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="static/utf8-jsp/ueditor.config.js"></script>
<script type="text/javascript" src="static/utf8-jsp/ueditor.all.js"></script>

<link rel="stylesheet" href="static/uploadify/uploadify.css" type="text/css"></link>
<script type="text/javascript" src="static/uploadify/jquery.uploadify.min.js"></script>

<div id="page-wrapper" style="margin-left: 0px;">
       
      <!--BEGIN CONTENT-->
		<!-- 知识分类e -->
		<div class="row" style="margin-left: 0px; margin-right: 0px; margin-top: -10px;">
			<div class="col-lg-12">
			 <form action="knowledge-edit-data-detail-update-method.html" method="post" enctype="multipart/form-data" name="wsxForm" id="wsxForm" class="Huiform wsxForm">
					<div id="generalTabContent" class="tab-content responsive">
						<div id="dp-tab" class="tab-pane fade in active">
							<div class="row">
								<?for( dataPropertiesName in dataProperties){
									if(dataPropertiesName.adminDetailShow == '1'){
										for(entry in data){
											var key = entry.key;
								?>

								<!-- 文本框（分词） -->
								<?if(dataPropertiesName.dataTypeId == 3){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" placeholder="" disabled="true" value="${entry.value}" class="form-control" name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
										/>
									</div>
								</div>
									<?}
								}?>

								<!-- 文本框（不分词） -->
								<?if(dataPropertiesName.dataTypeId == 2){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" disabled="true" onchange="verify(this.value,this.name)" demo="${entry.value}" value="${entry.value}" class="form-control"
											value="${entry.value}" name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
								<!-- 金额 -->
								<?if(dataPropertiesName.dataTypeId == 21){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" disabled="true" onchange="verify(this.value,this.name)" demo="${entry.value}" value="${entry.value}" class="form-control"
											value="${entry.value}" name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
								<!-- 密码 -->
								<?if(dataPropertiesName.dataTypeId == 14){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="password" disabled="true" placeholder="" value="${entry.value}" class="form-control"
											value="${entry.value}" name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
							
								<!-- 文本域 -->
								<?if(dataPropertiesName.dataTypeId ==4){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-12">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<textarea id=${dataPropertiesName.nameEn} rows="4" disabled="true" class="form-control" name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
										>${entry.value}</textarea>
									</div>
								</div>
									<?}
								}?>

								<!-- HTML（大区域） -->
								<?if(dataPropertiesName.dataTypeId ==6){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-12">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}</label>
											<script id="${dataPropertiesName.nameEn}" name="${dataPropertiesName.nameEn}" type="text/plain">${entry.value}</script>
												<script type="text/javascript" >
													var ue = UE.getEditor('${dataPropertiesName.nameEn}',{ initialFrameHeight:300 ,readonly:true });
											</script>
										</div>
									</div>
									<?}
								}?>

								<!-- HTML（小区域） -->
								<?if(dataPropertiesName.dataTypeId == 5){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}：</label>
											<script id="${dataPropertiesName.nameEn}" name="${dataPropertiesName.nameEn}" type="text/plain">${entry.value}</script>
											<script type="text/javascript" >
												var ue = UE.getEditor('${dataPropertiesName.nameEn}',{ initialFrameHeight:200 ,
											toolbars: [
												['undo', 'redo','|', 'bold', 'italic','underline','|','paragraph','fontfamily',
													'fontsize','forecolor','|', 'justifyleft','justifyright','justifycenter','justifyjustify',
													'|','removeformat','formatmatch','|','rowspacingtop','rowspacingbottom','lineheight','insertorderedlist','insertunorderedlist'
												]
											 ],
											readonly:true				 
											});
											</script>
										</div>
									</div>
									<?}
								}?>

								<!-- 下拉菜单（单值） -->
								<?if(dataPropertiesName.dataTypeId == 7){
									if(key==dataPropertiesName.nameEn){ ?>
									
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){ ?>
												<span class='require'>*</span>
											<?} ?>
											</label>
											<div class="form-group">
												<?for( dMap in dictsMap){?>
												<?if(dataPropertiesName.dictId == dMap.key){ ?>
												<?if(dMap.value == 1){ ?>
													<select class="form-control" id="${dataPropertiesName.id}" disabled="true" name="${dataPropertiesName.nameEn}" 
													<?if(dataPropertiesName.formValidationRegulation !=''){?>
														datatype="${dataPropertiesName.formValidationRegulation}"
													<?} else {?>
														ignore="ignore"
													<?}?>
													>
													<option value=''>--请选择--</option>
														<?for(res in resultString){
																if(res.dpid==dataPropertiesName.id){
																	if(res.value == entry.value){?>
															<option value="${res.value}" selected="selected">${res.nameZh}</option>
															<?}else{?>
															<option value="${res.value}">${res.nameZh}</option>
															<?}
															}
															}?>
												</select>
												<? } else { ?>
												<div class="input-group input-group-sm mbs">
												<?for(res in resultString){
																if(res.dpid==dataPropertiesName.id){
																	if(res.value == entry.value){ ?>
													<input id="dictitemName_${dataPropertiesName.id}" type="text" placeholder="${res.nameZh}" class="form-control" disabled="true" />
													<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value="${res.value}" 
														<?if(dataPropertiesName.formValidationRegulation !=''){?>
															datatype="${dataPropertiesName.formValidationRegulation}"
														<?} else {?>
															ignore="ignore"
														<?}?>
													/>
													 <?}
													 	}
													 		}?>
													 		<?for (dv in dicValue){ ?>
															 	<?if(dv.dictDpId == dataPropertiesName.nameEn){ ?>
																		<?if(dv.jieguoji == "" || dv.jieguoji == null){ ?>
															 		<input id="dictitemName_${dataPropertiesName.id}" type="text" placeholder="请点击选择"" class="form-control" disabled="true" />
																	<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value="" 
																<?if(dataPropertiesName.formValidationRegulation !=''){ ?>
																	datatype="${dataPropertiesName.formValidationRegulation}"
																<?} else { ?>
																	ignore="ignore"
																<?}?>
															/>
															 <?}
															 		}
															 			}?>
													 <span class="input-group-btn">
											 			<button id="t_${dataPropertiesName.id}" disabled="true" onclick="saveEditZTree('${dataPropertiesName.dictId}','${dataPropertiesName.id}')" type="button" data-toggle="dropdown"
															class="btn btn-success dropdown-toggle">选择类..</button>
													</span>
												</div> 
												
												<? }}} ?>
												
											</div>
										</div>
									</div>
									<? }
								
								}?>
									<!-- 下拉菜单（多值） -->
								<?if(dataPropertiesName.dataTypeId == 20){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label>
											<?for(multi in multiList){
														var multikey = multi.key;
														if(multikey == dataPropertiesName.nameEn){
													?>
												<input id=${dataPropertiesName.nameEn} type="text" placeholder="" disabled="true" value="${multi.value}" class="form-control" name=${dataPropertiesName.nameEn} 
													<?if(dataPropertiesName.formValidationRegulation !=''){?>
														datatype="${dataPropertiesName.formValidationRegulation}"
													<?} else {?>
														ignore="ignore"
													<?}?>
												/>
											<?}}?>
													
										</div>
									</div>
									<?}
								}?>

								<!-- 上传图片（单个） -->
								<?if(dataPropertiesName.dataTypeId == 8){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label><br/>
												<div style= "display:inline " id="single_${dataPropertiesName.id}">
												<?if(entry.value != ''){?>
													<img src="${uploadPath}${entry.value}" onclick="querypho()" width="30" height="30"/>
												<?}?>
												</div>
												<div id="phs" style="display: none;text-align:center;margin:0 auto;">
													<?if(entry.value != ''){?>
														<img src="${uploadPath}${entry.value}"  width="600px" height="480px"/>
													<?}?>
												</div>
										 			<!-- <input type="button" class="btn btn-primary" disabled="true" onclick="upload('${dataPropertiesName.id}',1)" value="编辑图片"  /> -->
   													<input type="hidden" id="singlePhone_${dataPropertiesName.id}"  /> 
   													<input type="hidden" value="${entry.value}" name=${dataPropertiesName.nameEn} id="onePhone_${dataPropertiesName.id}" 
   														<?if(dataPropertiesName.formValidationRegulation !=''){?>
															datatype="${dataPropertiesName.formValidationRegulation}"
														<?} else {?>
															ignore="ignore"
														<?}?>
   													 /> 
										</div>
									</div>
									<?}
								}?>

								<!-- 上传图片（多个） -->
								<?if(dataPropertiesName.dataTypeId == 26){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label><br/>
												<div style= "display:inline " id="single_${dataPropertiesName.id}">
													<?if(entry.value != ''){?>
														${entry.value}
													<?}?>
												</div>
												<div id="phsmuch" style="display: none;text-align:center;margin:0 auto;">
													
												</div>
   													<input type="hidden" id="singlePhone_${dataPropertiesName.id}"  /> 
   													<?for (pp in picturePath){
   														if(pp.key == dataPropertiesName.nameEn){
   													?>
	   													<input type="hidden" value="${pp.value}" name=${dataPropertiesName.nameEn} id="onePhone_${dataPropertiesName.id}" 
	   														<?if(dataPropertiesName.formValidationRegulation !=''){?>
																datatype="${dataPropertiesName.formValidationRegulation}"
															<?} else {?>
																ignore="ignore"
															<?}?>
	   													 /> 
   													 <?}}?>
										</div>
									</div>
									<?}
								}?>

								<!-- 上传附件（单个） -->
								<?if(dataPropertiesName.dataTypeId == 16|| dataPropertiesName.dataTypeId == 24|| dataPropertiesName.dataTypeId == 25){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label><br/>
											<div style= "display:inline " id="singleName_${dataPropertiesName.id}">
												${entry.value}
											</div>
   											<?for (pp in picturePath){
   												if(pp.key == dataPropertiesName.nameEn){
   											?>
   												<input type="hidden" name=${dataPropertiesName.nameEn} id="oneFile_${dataPropertiesName.id}" value="${pp.value}" />
											<?}}?>
									</div>
								</div>
								<?}
									}?>

								<!-- 上传附件（多个） -->
								<?if(dataPropertiesName.dataTypeId == 17){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label><br/>
										<div style= "display:inline " id="adjunctname_${dataPropertiesName.id}">
											${entry.value}
										</div>
   										<?for (pp in picturePath){
   												if(pp.key == dataPropertiesName.nameEn){
   											?>
   												<input type="hidden" name=${dataPropertiesName.nameEn} id="singleAdjunctmuch_${dataPropertiesName.id}" value="${pp.value}" />
											<?}}?>
									</div>
								</div>
								<?}
									}?>
									<!-- 文件转换pdf -->
								<?if(dataPropertiesName.dataTypeId == 27){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label><br/>
										<div style= "display:inline " id="adjunctname_${dataPropertiesName.id}">
											${entry.value}
										</div>
   										<?for (pp in picturePath){
   												if(pp.key == dataPropertiesName.nameEn){
   											?>
   												<input type="hidden" name=${dataPropertiesName.nameEn} id="singleAdjunctmuch_${dataPropertiesName.id}" value="${pp.value}" />
											<?}}?>
									</div>
								</div>
								<?}
									}?>
								<!-- 数值 -->
								<?if(dataPropertiesName.dataTypeId == 9){
														if(key==dataPropertiesName.nameEn){
											?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
													<span class='require'>*</span>
												<?} ?>
											</label>
											<input id=${dataPropertiesName.nameEn} disabled="true" type="text" placeholder="" class="form-control" value="${entry.value}"
												name=${dataPropertiesName.nameEn} 
												<?if(dataPropertiesName.formValidationRegulation !=''){?>
													datatype="${dataPropertiesName.formValidationRegulation}"
												<?} else {?>
													ignore="ignore"
												<?}?>
												/>
										</div>
									</div>
									<?}
								}?>
								<!-- 阿里云上传 -->
								<?if(dataPropertiesName.dataTypeId == 22){
									if(key==dataPropertiesName.nameEn){?>
									<div class="col-lg-6">
										<div class="form-group">
											<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
											<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
											</label>
											
											<div class="input-group input-group-sm mbs">
													<input id="dictitemName_${dataPropertiesName.id}" type="text" value='${entry.value}' class="form-control" disabled="true" />
													 <span class="input-group-btn">
													 	<button id="t_${dataPropertiesName.id}" onclick="aliyunUploading('${dataPropertiesName.id}')" type="button" data-toggle="dropdown" disabled="true" class="btn btn-success dropdown-toggle">选择文..</button>
													</span>
														<input name="${dataPropertiesName.nameEn}" id="dictitemId_${dataPropertiesName.id}" type="hidden" class="form-control" value='${entry.value}' 
												<?if(dataPropertiesName.formValidationRegulation !=''){?>
													datatype="${dataPropertiesName.formValidationRegulation}"
												<?} else {?>
													ignore="ignore"
												<?}?>
												/>
											</div>
										</div>
									</div>
									<?}
								}?>
								<!-- 超链接 -->
								<?if(dataPropertiesName.dataTypeId == 23){
									if(key==dataPropertiesName.nameEn){?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" disabled="true" demo="${entry.value}" value="${entry.value}" class="form-control"
											name="${dataPropertiesName.nameEn}" 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
									<?}
								}?>
								<!-- 日期（年） -->
								<?if(dataPropertiesName.dataTypeId == 10){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy'})"
											class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn}  disabled="true"
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年-月） -->
								<?if(dataPropertiesName.dataTypeId == 11){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM'})"
											class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn} disabled="true"
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											 />
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年-月-日） -->
								<?if(dataPropertiesName.dataTypeId == 12){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
											class="form-control" value="${entry.value}"
											name=${dataPropertiesName.nameEn}  disabled="true"
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>

								<!-- 日期（年-月-日 时-分-秒） -->
								<?if(dataPropertiesName.dataTypeId ==13){
														if(key==dataPropertiesName.nameEn){
											?>
								<div class="col-lg-6">
									<div class="form-group">
										<label for="inputPhone" class="control-label">${dataPropertiesName.nameZh}
										<?if(dataPropertiesName.formValidationRegulation == '*'){?>
												<span class='require'>*</span>
											<?} ?>
										</label>
										<input id=${dataPropertiesName.nameEn} type="text" value="${entry.value}"
											onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss'})"
											class="form-control" disabled="true"
											name=${dataPropertiesName.nameEn} 
											<?if(dataPropertiesName.formValidationRegulation !=''){?>
												datatype="${dataPropertiesName.formValidationRegulation}"
											<?} else {?>
												ignore="ignore"
											<?}?>
											/>
									</div>
								</div>
								<?}
												}?>
								<?}?>

								<?}?>
								<?}?>
	
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>

     <!--END CONTENT-->
</div>

<?}?>
<script type="text/javascript">
	var curr;
	var dictId ;
	function getdictIdZTree(){
		return dictId
	}
	var did = null; 
	var number = null;
	
	function getlay() {  
            return did;
    }
    
	function getnumber() {  
            return number;
    }
	
	var choiceId;
	var choicerRelevanceId;
	function getchoiceId() {  
            return choiceId;
    }
    
	function getchoicerRelevanceId() {  
            return choicerRelevanceId;
    }
		
	function getid() {
		return $("#idString").val();
	}
	function getclassid() {
		return $("#classesId").val();
	}
	function getclassname() {
		
		return $("#classesEn").val();
	}
	
function saveEditZTree(id) {
		dictId=id;
		layer.open({
					type : 2,
					area : [ '410px', '400px' ],
					fix : false, //不固定
					maxmin : true,
					scrollbar : false,
					shadeClose : true,
					title : '字典项管理',
					btn : [ '保存 ', '关闭' ],
					skin : 'layui-layer-rim', //加上边框
					content : ["knowledge-edit-data-ztree.html",'no'],
					yes : function(index, layer) {
						//alert(index);
						 var iframeWin = parent.window[layer.find('iframe')[0]['name']];
						//alert(iframeWin);
						iframeWin.queren();
					},
					cancel : function(index) {
					}
				});
			};




	//所属  字典类Id
	//树状结构
	
	function initTree(id) {
	did = id;
	var nameEn = $("#classesEn").val();
		$.ajax({
			type : "post",
			data : {
			"did" : did,
			"nameEn" : nameEn,
			},
			url : "knowledge-edit-data-detail-ajax.html",
			dataType : "json",
			beforeSend : function(XMLHttpRequest) {},
			success : drawTree,
		});
	}
	var setting = {
			check: {
				enable: true,
				chkboxType: {"Y":"", "N":""}
			},
			view: {
				dblClickExpand: false
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				beforeClick: beforeClick,
				onCheck: onCheck
			}
		};
	function drawTree(data) {
		var zNodes = eval(data);
		$.fn.zTree.init($("#"+did), setting, zNodes).expandAll(true);
		showMenu();
		/*  alert(JSON.stringify(zNodes));  */
	}
	
	function beforeClick(treeId, treeNode) {
		var zTree = $.fn.zTree.getZTreeObj(did);
		zTree.checkNode(treeNode, !treeNode.checked, null, true);
		return false;
	}
		
	function onCheck(e, treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj(did),
			nodes = zTree.getCheckedNodes(true),
			v = "";
			for (var i=0, l=nodes.length; i<l; i++) {
				v += nodes[i].name + ",";
			}
			if (v.length > 0 ) v = v.substring(0, v.length-1);
			var cityObj = $("#citySel_"+did);
			cityObj.attr("value", v);
		}

		function showMenu() {
		
			var cityObj = $("#citySel_"+did);
			var cityOffset = $("#citySel_"+did).offset();
			$("#menuContent_"+did).css({left:cityOffset.left + "px", top:cityOffset.top + cityObj.outerHeight() + "px"}).slideDown("fast");

			$("body").bind("mousedown", onBodyDown);
		}
		function hideMenu() {
			$("#menuContent_"+did).fadeOut("fast");
			$("body").unbind("mousedown", onBodyDown);
		}
		function onBodyDown(event) {
			if (!(event.target.id == "menuBtn_"+did || event.target.id == "citySel_"+did || event.target.id == "menuContent_"+did || $(event.target).parents("#menuContent_"+did).length>0)) {
				hideMenu();
			}
		}		
		
		
	
	
	//验证
var wsxForm;

$(function(){
	
	wsxForm = $(".wsxForm").Validform({
		tiptype:1,
		tipSweep:true
	});
	
});
function submitForm() {
	// wsxForm.submitForm(false);
	wsxForm.ajaxPost(false);
	return wsxForm.getStatus();
}

function save(){   
	 var index = parent.layer.getFrameIndex(window.name); 
	 parent.layer.msg('已关闭！');
 	 parent.layer.close(index); 
    } 
//图片放大
function querypho(){
	var index=layer.open({
	  type: 1,
	  title: false,
	  closeBtn: 1,
	  area: ['600px','480px'],
	  skin: 'layui-layer-nobg', //没有背景色
	  shadeClose: true,
	  content: $('#phs')
	});
	 layer.iframeAuto(index);
}
function querypicture(inagesUrl){
	//var singph = $("#singlePhone_"+inagesUrl).val();
	$('#phsmuch').html("<img src=\""+inagesUrl+"\" style='height: auto;max-height: 500px;' />");
	var index=layer.open({
	  type: 1,
	  title: false,
	  closeBtn: 1,
	  area: ['auto','auto'],
	  skin: 'layui-layer-nobg', //没有背景色
	  shadeClose: true,
	  content: $('#phsmuch')
	});
	layer.iframeAuto(index);
}
</script>